<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			if (this.token) {
				this.$http.post('api/UsersPublic/getuse').then(res => {
					if (res.code == 0) {
						this.$store.commit('saveInfo', {
							userinfo: res.data
						});
					} else {
						uni.showToast({
							title: '登录超时！',
							icon: 'none'
						});
						setTimeout(function() {
							uni.reLaunch({
								// url: '/pages/login/login'
							});
						}, 700);
						this.$store.commit('logout');
					}
					uni.hideLoading();
				});
			} else {
				uni.reLaunch({
					// url: '/pages/login/login'
				});
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	page {
		// background-color: #FFFFFF;
	}

	/*每个页面公共css */
	@import 'uview-ui/index.scss';
	@import './static/css/iconfont.css';
	/*每个页面公共css */
	@import 'static/css/common.scss';

	.green {
		color: #FFFFFF;
		background-color: #51D476;
	}

	.orange {
		color: #FFFFFF;
		background-color: #FF9A3E;
	}

	.blue {
		color: #FFFFFF;
		background-color: #4A81D3;
	}

	.grayness {
		color: #FFFFFF;
		background-color: #A9A9A9;
	}

	.yellow {
		color: #333;
		background-color: #FFEC3E;
	}

	.danger {
		color: #FFFFFF;
		background-color: #D84B4B;
	}
</style>
